// api/test.js
//导入封装的方法
import request from '../utils/request'
//登录
export function login(openId) {
    return request({
        url: `/wechat/miniapp/login?openId=${openId}`,
        method: 'post',
    })
}
//登录
export function miniapp(data) {
  return request({
      url: `/wechat/miniapp`,
      method: 'post',
      data:data
  })
}

// 轮播图片
export function slider() {
  return request({
      url: `/wechat/mini/promotion/slider`,
      method: 'get',
  })
}
// 轮播详情
export function sliderInfo(id) {
  return request({
      url: `/wechat/mini/promotion/slider/${id}`,
      method: 'get',
  })
}

//酒品分类 
export function categoryAll() {
  return request({
      url: `/wechat/mini/category/all`,
      method: 'get',
  })
}

//绑定机器
export function deviceBind(data) {
  return request({
    url: `/wechat/mini/device/bind`,
    method: 'post',
    data:data
})
}
//预览订单
export function orderPreview(data) {
  return request({
    url: `/wechat/mini/order/preview`,
    method: 'post',
    data:data
})
}

//提交订单
export function orderCommit(data) {
  return request({
    url: `/wechat/mini/order/commit`,
    method: 'post',
    data:data
})
}

//订单列表
export function orderList(data) {
  return request({
    url: `/wechat/mini/order/list`,
    method: 'get',
    data
})
}


//设备列表

export function deviceList(data) {
  return request({
    url: `/wechat/mini/device/list`,
    method: 'get'
})
}

//设备加酒
export function deviceAttrAdd(data) {
  return request({
    url: `/wechat/mini/device/attr/add`,
    method: 'post',
    data
})
}
//规格详情
export function deviceAttr(id) {
  return request({
    url: `/wechat/mini/device/${id}`,
    method: 'get'
})
}
//规格详情
export function deviceAttrs(id) {
  return request({
    url: `/wechat/mini/device/attr/${id}`,
    method: 'get'
})
}
//操作记录
export function operationList(data) {
  return request({
    url: `/wechat/mini/device/operation/list`,
    method: 'get',
    data:data
})
}
//订单详情
export function orderDetail(orderId) {
  return request({
    url: `/wechat/mini/order/detail/${orderId}`,
    method: 'get'
})
}

//详情
export function getUserInfo() {
  return request({
    url: `/wechat/miniapp/getUserInfo`,
    method: 'get'
})
}
export function updatePhone(data) {
  return request({
    url: `/wechat/miniapp/updatePhone`,
    method: 'post',
    data
})
}
// 
//
export function miniPay(data) {
  return request({
    url: `/wechat/mini/pay`,
    method: 'post',
    data
})
}

